package com.renker.blog.common.utils;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoggerUtil {
	private static ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
	
	public static Logger getLogger(){
		return loggerFactory.getLogger(Thread.currentThread().getStackTrace()[2].getClassName());
	}
	
	private static Logger logger(){
		return loggerFactory.getLogger(Thread.currentThread().getStackTrace()[3].getClassName());
	}
	
	public static void info(String msg){
		if (logger().isInfoEnabled()) {
			logger().info(msg);
		}
	}
	
	public static void debug(String msg){
		if (logger().isDebugEnabled()) {
			logger().debug(msg);
		}
	}
}
